﻿using Furion.DynamicApiController;

namespace Teambuy.Services
{
    public class TestServices : IDynamicApiController
    {
        private readonly ISqlSugarClient db;

        public TestServices(ISqlSugarClient db)
        {
            this.db = db;
        }

        /// <summary>
        /// 初始化数据库
        /// </summary>
        /// <returns></returns>
        public async Task<object> Init()
        {
            //db.CodeFirst.InitTables<Entity.Cash>();

            //db.CodeFirst.InitTables<Entity.CashAccount>();

            //db.CodeFirst.InitTables<Entity.Client>();

            //db.CodeFirst.InitTables<Entity.ClientAddress>();

            //db.CodeFirst.InitTables<Entity.ClientMoneyLog>();

            //db.CodeFirst.InitTables<Entity.ClientPoints>();

            //db.CodeFirst.InitTables<Entity.ClientPointsLog>();

            //db.CodeFirst.InitTables<Entity.Express>();

            //db.CodeFirst.InitTables<Entity.Order>();

            //db.CodeFirst.InitTables<Entity.Proxy>();

            //db.CodeFirst.InitTables<Entity.ProxyMoneyLog>();

            //db.CodeFirst.InitTables<Entity.SignLog>();

            //db.CodeFirst.InitTables<Entity.TeamBuy>();

            //db.CodeFirst.InitTables<Entity.TeamBuyLog>();

            //db.CodeFirst.InitTables<Entity.TeamBuyPrize>();

            //db.CodeFirst.InitTables<Entity.TeamBuyProduct>();

            //db.CodeFirst.InitTables<Entity.TeamBuyReference>();

            //db.CodeFirst.InitTables<Entity.TeambuyUserRedPacketLog>();

            //db.CodeFirst.InitTables<Entity.Store>();

            //db.CodeFirst.InitTables<Entity.StoreMoneyLog>();

            //db.CodeFirst.InitTables<Entity.PointsActivety.PointsActivity>();

            //db.CodeFirst.InitTables<Entity.PointsActivety.PointsActivityOutQueue>();

            //db.CodeFirst.InitTables<Entity.PointsActivety.PointsActivityQueue>();

            //db.CodeFirst.InitTables<Entity.PointsActivety.PointsActivityTask1>();

            //db.CodeFirst.InitTables<Entity.MonthProduct>();

            //db.CodeFirst.InitTables<Entity.ClientMonthProductLog>();

            //db.CodeFirst.InitTables<Entity.ClientGlod>();

            //db.CodeFirst.InitTables<Entity.ClientGlodLog>();

            //db.CodeFirst.InitTables<Entity.Orders.Order_Out_PintsActivity>();

            db.CodeFirst.InitTables<Entity.Orders.Order_Ext_MonthProduct>();

            return await Task.FromResult("ok");
        }
    }
}
